//
// Created by win10 on 2021/1/4.
//

#ifndef BACKHEADSHARE_EVENTEMITTER_H
#define BACKHEADSHARE_EVENTEMITTER_H
#include <string>
#include <unordered_map>
#include <functional>

// interface
class EventEmitter {
public:
    EventEmitter() = default;

    virtual ~EventEmitter() = default;

    virtual void emit(const std::string &event) = 0;

    virtual void on(const std::string &event, const std::function<void()> &callback) = 0;
};


#endif //BACKHEADSHARE_EVENTEMITTER_H
